/*
 * Copyright (c) JiaChaoYang 2023-7-27 MongoPlus版权所有
 * 适度编码益脑，沉迷编码伤身，合理安排时间，享受快乐生活。
 * email: j15030047216@163.com
 * phone: 15030047216
 * weChat: JiaChaoYang_
 */

package com.mongo.plus.demo.entity;

import com.anwen.mongo.annotation.ID;
import com.anwen.mongo.annotation.collection.CollectionField;
import com.anwen.mongo.annotation.collection.CollectionName;
import com.anwen.mongo.annotation.collection.Version;
import com.anwen.mongo.enums.FieldFill;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @Description:
 * @BelongsProject: mongo-plus-demo
 * @Version: 1.0
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@CollectionName(value = "user")
public class User implements Serializable {

    private static final long serialVersionUID = -8688216564849010572L;

    @ID
    private String id;

    @CollectionField(value = "userName")
    private String userName;

    @CollectionField(value = "createTime", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 乐观锁
     */
    @Version
    private Integer version;
}

